<template>
	<view class="nameInfo">
		<view  v-if="!auditShow">
			<other></other>
		</view>
		<view v-if="auditShow">
			<view class="flex_row_between_center nameInfo_item ">
				<view class="ge">
					<view class="ge1"></view>
					<view class="ge2"></view>
					<view class="ge3" v-if="nameInfo && nameInfo.name">{{nameInfo.name.slice(0,1)}}</view>
				</view>
				<view class="ge">
					<view class="ge1"></view>
					<view class="ge2"></view>
					<view class="ge3" v-if="nameInfo && nameInfo.name">{{nameInfo.name.slice(1,2)}}</view>
				</view>
				<view class="ge">
					<view class="ge1"></view>
					<view class="ge2"></view>
					<view class="ge3" v-if="nameInfo && nameInfo.name">{{nameInfo.name.slice(2,3)}}</view>
				</view>
			</view>
			<view class="flex_row_between_center  nameInfo_item nameInfo_item_1 ">
				<view class="geWuxing flex_row_center_center">
					{{nameWuxing[0]}}
				</view>
				<view class="geWuxing flex_row_center_center">
					{{nameWuxing[1]}}
				</view>
				<view class="geWuxing flex_row_center_center">
				{{nameWuxing[2]}}
				</view>
			</view>
			<view class="flex_row_center_center nameInfo_item nameInfo_item_2 ">
				<text style="font-size: 30rpx;font-weight: 550;letter-spacing: 6rpx;">当前名字得分：</text>
				<text style="font-size: 36rpx; font-weight: 550;letter-spacing: 4rpx;">{{nameInfo.scores}}</text>
			</view> 
			<!-- <view class="flex_row_center_center nameInfo_item  ">
				<view class="nameInfo_item_3 flex_row_center_center ">
					<view>
						<view class="nameInfo_item_3_top">优</view>
						<view class="nameInfo_item_3_bot">综合评价</view>
					</view>
				</view>
			</view>
			<view class=" nameInfo_bazi_items  ">
				<view class="nameInfo_bazi_title">八字五行资料</view>
				<view class="nameInfo_bazi">
					<view class="nameInfo_bazi_item flex_row_start_center">
						<view class="nameInfo_bazi_item_1">八字</view>
						<view class="nameInfo_bazi_item_1">年柱</view>
						<view class="nameInfo_bazi_item_1">月柱</view>
						<view class="nameInfo_bazi_item_1">日柱</view>
						<view class="nameInfo_bazi_item_1">时柱</view>
					</view>
					<view class="nameInfo_bazi_item flex_row_start_center" style="background-color: #fff;">
						<view class="nameInfo_bazi_item_1">天干</view>
						<view class="nameInfo_bazi_item_1 nameInfo_bazi_item_1bgc">{{baziInfo.nianZhu.tianGan.tianGan}}</view>
						<view class="nameInfo_bazi_item_1 nameInfo_bazi_item_1bgc">{{baziInfo.yueZhu.tianGan.tianGan}}</view>
						<view class="nameInfo_bazi_item_1 nameInfo_bazi_item_1bgc">{{baziInfo.shiZhu.tianGan.tianGan}}</view>
						<view class="nameInfo_bazi_item_1 nameInfo_bazi_item_1bgc">{{baziInfo.riZhu.tianGan.tianGan}}</view>
					</view>
					<view class="nameInfo_bazi_item flex_row_start_center" style="background-color: #fff;">
						<view class="nameInfo_bazi_item_1">地支</view>
						<view class="nameInfo_bazi_item_1 nameInfo_bazi_item_1bgc">{{baziInfo.nianZhu.diZhi.diZhi}}</view>
						<view class="nameInfo_bazi_item_1 nameInfo_bazi_item_1bgc">{{baziInfo.yueZhu.diZhi.diZhi}}</view>
						<view class="nameInfo_bazi_item_1 nameInfo_bazi_item_1bgc">{{baziInfo.shiZhu.diZhi.diZhi}}</view>
						<view class="nameInfo_bazi_item_1 nameInfo_bazi_item_1bgc">{{baziInfo.riZhu.diZhi.diZhi}}</view>
					</view>
				</view>
			</view>
			<view class="nameInfo_item_4">
				<view class="nameInfo_item_4_title">总论</view>
				<view class="nameInfo_item_4_dsc" v-for="(item,index) in pandectInfo" :key="index">{{item}}</view>
			</view>
			<view class="nameInfo_bgc"></view>
			<!-- 五行命理详细解析 -->
			<view class="nameInfo_item_5">
				<view class="nameInfo_item_title" style="text-align: center;">五行命理详细解析</view>
				<view class="nameInfo_item_label flex_row_start_center">
					<view class="nameInfo_item_label_1  flex_row_center_center">人</view>
					<view class="nameInfo_item_label_2">五行命理-人格</view>
					<view class="nameInfo_item_label_3">数理：{{nameInfo.personalityScore}}</view>
					<!-- <view class="nameInfo_item_label_4">凶</view> -->
				</view>
				<view class="flex_row_start_center nameInfo_item_5_desc" >
					<view style="width: 180rpx;">
						<uni-icons type="star-filled" size="30" color="#f3b852"></uni-icons>
					</view>
					<view >人格数是先祖留传下来的，其数理对人影响不大。(掘井无泉)无理之数，发展薄弱，虽生不足，难酬志向。</view>
				</view>
				<view class="nameInfo_item_5_hanyi">含义</view>
				<view class="nameInfo_item_5_descInfo">
					<jyfParser :html="nameInfo.personality" :isAll="true"></jyfParser>
				</view>
			</view>
			<view class="nameInfo_bgc"></view>
			<view class="nameInfo_item_5">
				<view class="nameInfo_item_label flex_row_start_center">
					<view class="nameInfo_item_label_1  flex_row_center_center">天</view>
					<view class="nameInfo_item_label_2">五行命理-天格</view>
					<view class="nameInfo_item_label_3">数理：{{nameInfo.tiangeSort}}</view>
					<!-- <view class="nameInfo_item_label_4">凶</view> -->
				</view>
				<view class="flex_row_start_center nameInfo_item_5_desc" >
					<view style="width: 180rpx;">
						<uni-icons type="star-filled" size="30" color="#f3b852"></uni-icons>
					</view>
					<view >天格数是先祖留传下来的，其数理对人影响不大(七政之数)七政之数，精悍严谨，天赋之力吉星照耀。</view>
				</view>
				<view class="nameInfo_item_5_hanyi">含义</view>
				<view class="nameInfo_item_5_descInfo">
					<jyfParser :html="nameInfo.tiange" :isAll="true"></jyfParser>
				</view>
				
			</view>
			<view class="nameInfo_bgc"></view>
			<view class="nameInfo_item_5">
				<view class="nameInfo_item_label flex_row_start_center">
					<view class="nameInfo_item_label_1  flex_row_center_center">地</view>
					<view class="nameInfo_item_label_2">五行命理-地格</view>
					<view class="nameInfo_item_label_3">数理：{{nameInfo.tiangeSort}}</view>
					<!-- <view class="nameInfo_item_label_4">凶</view> -->
				</view>
				<view class="flex_row_start_center nameInfo_item_5_desc" >
					<view style="width: 180rpx;">
						<uni-icons type="star-filled" size="30" color="#f3b852"></uni-icons>
					</view>
					<view >地格数是先祖留传下来的，其数理对人影响不大(旱苗逢雨)万物更新，调顺发达，恢弘泽世繁荣富贵。</view>
				</view>
				<view class="nameInfo_item_5_hanyi">含义</view>
				<view class="nameInfo_item_5_descInfo">
					<jyfParser :html="nameInfo.dige" :isAll="true"></jyfParser>
				</view>
			</view>
			<view class="nameInfo_bgc"></view>
			<view class="nameInfo_item_5">
				<view class="nameInfo_item_label flex_row_start_center">
					<view class="nameInfo_item_label_1  flex_row_center_center">外</view>
					<view class="nameInfo_item_label_2">五行命理-外格</view>
					<view class="nameInfo_item_label_3">数理：{{nameInfo.waigeSort}}</view>
					<!-- <view class="nameInfo_item_label_4">凶</view> -->
				</view>
				<view class="flex_row_start_center nameInfo_item_5_desc" >
					<view style="width: 180rpx;">
						<uni-icons type="star-filled" size="30" color="#f3b852"></uni-icons>
					</view>
					<view >外格数是先祖留传下来的，其数理对人影响不大(六爻之数)六爻之数，发展变化，天赋美德吉祥安泰。</view>
				</view>
				<view class="nameInfo_item_5_hanyi">含义</view>
				<view class="nameInfo_item_5_descInfo">
					<jyfParser :html="nameInfo.waige" :isAll="true"></jyfParser>
				</view>
			</view>
			<view class="nameInfo_bgc"></view>
			<view class="nameInfo_item_5">
				<view class="nameInfo_item_title">
					<view class="line">
						
					</view>
					<view class="">
						对基础运的影响
					</view>
					</view>
				<view class="nameInfo_item_number flex_row_start_center">
					<uni-icons type="star-filled" size="20" color="#f3b852"></uni-icons>
					<view class="nameInfo_item_number_1">对基础运的影响</view>
					<view class="nameInfo_item_number_2">{{nameInfo.basicTransportInfluence}}</view>
				</view>
				<view>{{nameInfo.basicTransport}}</view>
			</view>
			<view class="nameInfo_bgc"></view>
			<view class="nameInfo_item_5">
				<view class="nameInfo_item_title">
					<view class="line">
						
					</view>
					<view class="">
						对成功运的影响
					</view>
					</view>
				<view class="nameInfo_item_number flex_row_start_center">
					<uni-icons type="star-filled" size="20" color="#f3b852"></uni-icons>
					<view class="nameInfo_item_number_1">对成功运的影响</view>
					<view class="nameInfo_item_number_2">{{nameInfo.successfulLuckInfluence}}</view>
				</view>
				<view>{{nameInfo.successfulLuck}}</view>
			</view>
			<view class="nameInfo_bgc"></view>
			<view class="nameInfo_item_5">
				<view class="nameInfo_item_title">
					<view class="line">
						
					</view>
					<view class="">
						对人际关系的影响
					</view>
					</view>
				<view class="nameInfo_item_number flex_row_start_center">
					<uni-icons type="star-filled" size="20" color="#f3b852"></uni-icons>
					<view class="nameInfo_item_number_1">对人际关系的影响</view>
					<view class="nameInfo_item_number_2">{{nameInfo.interpersonalLuckInfluence}}</view>
				</view>
				<view>{{nameInfo.interpersonalLuck}}</view>
			</view>
			<view class="nameInfo_bgc"></view>
			<view class="nameInfo_item_5">
				<view class="nameInfo_item_title">
					<view class="line">
						
					</view>
					<view class="">
						天格有以下数理暗示
					</view>
					</view>
				<view class="nameInfo_item_shulianshi" >{{nameInfo.tiangeHint}}</view>
			</view>
			<view class="nameInfo_bgc"></view>
			<view class="nameInfo_item_5">
				<view class="nameInfo_item_title">
					<view class="line">
						
					</view>
					<view class="">
						人格有以下数理暗示
					</view>
					</view>
				<view class="nameInfo_item_shulianshi" >{{nameInfo.personalityHint}}</view>
			</view>
			<view class="nameInfo_bgc"></view>
			<view class="nameInfo_item_5">
				<view class="nameInfo_item_title">
					<view class="line">
						
					</view>
					<view class="">
						地格有以下数理暗示
					</view>
					</view>
				<view class="nameInfo_item_shulianshi" >{{nameInfo.digeHint}}</view>
			</view>
			<view class="nameInfo_bgc"></view>
			<view class="nameInfo_item_5">
				<view class="nameInfo_item_title">
					<view class="line">
						
					</view>
					<view class="">
						外格有以下数理暗示
					</view>
					</view>
				<view class="nameInfo_item_shulianshi" >{{nameInfo.waigeHint}}</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import jyfParser from '@/components/jyf-parser/jyf-parser'
	import other from '@/components/other/index.vue'
	export default{
		components:{jyfParser,other},
		data(){
			return{
				nameInfo:{},
				pandectInfo:'',//总论
				tiangeHintList:[],
				baziInfo:{},
				auditShow:false,
				nameWuxing:[],//名字五行
			}
		},
		onLoad(options){
			this.getAudit()
			if ('params' in options) {
			      let obj = JSON.parse(decodeURIComponent(options.params));
				  console.log(obj);
				 this.getInfo(obj.nameGradeId)
				 if(obj.isLeap == null){
					 //阳历
					 this.getCalendar(obj)
				 }else{
					 //阴历
					 this.getSolarCalendar(obj)
				 }
			 }
		},
		methods:{
			//获取微信审核开关
			getAudit(){
			    let param = {};
				param.url='v3/system/front/configuration/1'
				this.$request(param).then(res=>{
					console.log(res);
					this.auditShow=res.data.auditSwitch
					if(this.auditShow){
						uni.setNavigationBarTitle({
							title:'详情'
						})
					}
				})
			},
			//阴历获取八字
			getSolarCalendar(value){
				let param = {};
				param.method="POST"
				param.urls='scbz/bz/convertedSolarCalendar'
				param.header={
					'Content-Type': 'application/json;charset=utf-8',
				}
				param.data={}
				param.data.year=value.year
				param.data.month=value.month
				param.data.day=value.day
				param.data.hour=value.hour
				param.data.minute=value.minute
				param.data.gender=value.gender
				param.data.isLeap=value.isLeap
				param.data.name=value.name
				
				this.$request(param).then(res=>{
					console.log('阴历',res);
					
				})
			},
			//阳历获取八字
			getCalendar(value){
				let param = {};
				param.urls='scbz/bz/convertedCalendar'
				param.header={
					'Content-Type': 'application/json;charset=utf-8',
				}
				param.method='POST'
				param.data={}
				param.data.year=value.year
				param.data.month=value.month
				param.data.day=value.day
				param.data.hour=value.hour
				param.data.minute=value.minute
				param.data.gender=value.gender
				param.data.isLeap=value.isLeap
				param.data.name=value.name
				
			 
				this.$request(param).then(res=>{
					  
					this.baziInfo=res.baZiWuXing
					
				})
			},
			getInfo(nameGradeId){
				let _this=this
				let param = {};
				param.url='v3/name/grade/front/detail/'+nameGradeId
				
				this.$request(param).then(res=>{
					
					_this.nameInfo=res.data
					// 数据处理
					_this.nameWuxing=_this.nameInfo.nameWuXing.split('-')
					console.log(_this.nameWuxing),'333';
					_this.pandectInfo=res.data.pandect.split('。')
				})
			},
		}
	}
</script>

<style lang="scss">
	.nameInfo{
		padding: 40rpx 0rpx 80rpx 0;
		background-color: #fff;
	}
	.nameInfo_item{
		padding: 10rpx 132rpx;
		background-color: #fff;
	}
	.nameInfo_bgc{
		width: 750rpx;
		height: 30rpx;
		margin: 10rpx 0;
		background-color: #f5f5f5;
	}
	.ge{
		width: 120rpx;
		height: 120rpx;
		// border: 2rpx dashed #a4a4a4;
		border: 2rpx solid #88b7ff;
		position: relative;
		overflow: hidden;
		
	}
	.ge1{
		position: absolute;
		left: 50%;
		top: 0;
		width: 20rpx;
		height: 100%;
		border-left: 2rpx dashed #88b7ff;
	}
	.ge2{
		position: absolute;
		left: 0;
		top: 50%;
		width: 100%;
		height: 2rpx;
		border-bottom: 2rpx dashed #88b7ff;
	}
	.ge3{
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%,-50%);
		font-size: 70rpx;
		font-weight: bold;
		
	}
	.geWuxing{
		width: 120rpx;
		height: 60rpx;
		font-size: 30rpx;
		color: #88b7ff;
		font-weight: 550;
	}
	.nameInfo_bazi_items{
		margin: 40rpx  32rpx;
	}
	.nameInfo_bazi{
		width: 680rpx;
		border: 2rpx solid #dddddd;
		.nameInfo_bazi_item{
			background-color: #fff3d9;
			border-bottom: 2rpx solid #dddddd;
			&:last-child{
				border-bottom: 0;
			}
			
			.nameInfo_bazi_item_1{
				width: 136rpx;
				border-right: 2rpx solid #dddddd;
				display: flex;
				justify-content: center;
				padding: 18rpx 0;
				color: #7f511f;
				font-size: 28rpx;
				
				&:last-child{
					border-right: 0;
				}
			}
			.nameInfo_bazi_item_1bgc{
				color: #000 !important;
			}
		}
	}
	.nameInfo_bazi_title{
		text-align: center;
		font-size: 36rpx;
		font-weight: bold;
		margin-bottom: 20rpx;
	}
	.nameInfo_item_1{
		font-size: 30rpx;
	}
	.nameInfo_item_2{
		font-size: 28rpx;
		& text:last-child{
			color: #88b7ff;
			margin-left: 20rpx;
		}
	}
	
	.nameInfo_item_3{
		width: 160rpx;
		height: 160rpx;
		border: 2rpx solid #dacbaa;
		background-color: #fff3d9;
	}
	.nameInfo_item_3_top{
		font-size: 60rpx;
		color: #fc5654;
		text-align: center;
	}
	.nameInfo_item_3_bot{
		font-size: 28rpx;
		margin-top: 10rpx;
	}
	
	.nameInfo_item_4{
		padding: 20rpx 42rpx;
		background-color: #fff;
	}
	.nameInfo_item_4_title{
		text-align: center;
		font-size: 36rpx;
		font-weight: bold;
		margin-bottom: 20rpx;
	}
	.nameInfo_item_4_dsc{
		font-size: 26rpx;
	}
	
	.nameInfo_item_5{
		margin-top: 20rpx;
		padding: 34rpx 32rpx;
		font-size: 28rpx;
		border-top: 2rpx solid #cecece;
		letter-spacing: 4rpx;
	}
	.nameInfo_item_title{
		font-size: 38rpx;
		font-weight: bold;
		text-align: left;
		margin-bottom: 20rpx;
		display: flex;
		align-items: center;
		
		.line{
			width: 10rpx;
			height: 40rpx;
			background-color: #88b7ff;
			border-radius: 4rpx;
			margin-right: 10rpx;
		}
	}
	.nameInfo_item_label{
		background-color: #f5f5f5;
		margin: 0 32rpx;
		height: 90rpx;
		border-radius: 0rpx 40rpx 40rpx 0;
		.nameInfo_item_label_1{
			width: 90rpx;
			height: 90rpx;
			background-color:#88b7ff;
			color: #fff;
			font-size: 42rpx;
			// border-radius: 40rpx 0 0 40rpx;
		}
		.nameInfo_item_label_2{
			font-size: 32rpx;
			font-weight: bold;
			width: 280rpx;
			padding-left: 20rpx;
		}
		.nameInfo_item_label_3{
			font-size: 32rpx;
			font-weight: bold;
			width: 180rpx;
			color: #88b7ff;
		}
		.nameInfo_item_label_4{
			color: #fe0707;
			font-size: 28rpx;
		}
	}
	.nameInfo_item_5_desc{
		padding: 18rpx 30rpx;
	}
	.nameInfo_item_5_hanyi{
		background-color: #f5f5f5;
		color: #835727;
		font-size: 26rpx;
		padding: 20rpx 20rpx;
		width: 110rpx;
		text-align: center;
		margin-left: 30rpx;
	}
	.nameInfo_item_5_descInfo{
		padding: 18rpx 12rpx 5rpx 36rpx;
		font-size: 28rpx;
	}
	.nameInfo_item_number{
		font-size: 28rpx;
		background-color: #f5f5f5;
		padding: 15rpx 20rpx;
		margin-bottom: 18rpx;
		.nameInfo_item_number_1{
			color: #7f511f;
			padding: 0 20rpx;
		}
		.nameInfo_item_number_2{
			color: #88b7ff;
			font-weight: 550;
		}
	}
	.nameInfo_item_shulianshi{
		font-size: 28rpx;
	}
</style>